home *** CD-ROM | disk | FTP | other *** search
/ kermit.columbia.edu / kermit.columbia.edu.tar / kermit.columbia.edu / newsgroups / misc.19990422-19990725 / 000266_news@columbia.edu _Mon Jul 12 16:20:29 1999.msg < prev    next >
Internet Message Format  |  1999-07-23  |  2KB

  1. Return-Path: <news@columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id QAA09652
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Mon, 12 Jul 1999 16:20:28 -0400 (EDT)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id QAA01168
  7.     for kermit.misc@watsun.cc.columbia.edu; Mon, 12 Jul 1999 16:15:47 -0400 (EDT)
  8. X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
  9. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  10. Subject: Re: Incrementing a value stored as a macro
  11. Date: 12 Jul 1999 20:15:46 GMT
  12. Organization: Columbia University
  13. Message-ID: <7mdidi$14d$1@newsmaster.cc.columbia.edu>
  14. To: kermit.misc@columbia.edu
  15.  
  16. In article <7md91i$p30$1@nnrp1.deja.com>,
  17. quertyq@hotmail.com  <quertyq@hotmail.com> wrote:
  18. : Good Afternoon:
  19. : I am using Kermit 95 Version 1.l.17.
  20. : How can I have a value currently assigned as a macro, to be
  21. : treated as an integer, and have it incremented?
  22. If the macro is called "foo" and its value is numeric:
  23.  
  24.   increment foo
  25.  
  26. : Let me explain ...
  27. : I am using Figure 18-2 Mass mailing script as the example
  28. : ( pg 412 in the 2nd edition C-Kermit manual ):
  29. :   def SPLIT {
  30. :     asg name \%1
  31. :     asg user \%2
  32. :   }
  33. : My code snippet is as follows:
  34. :   define valu 7
  35. :   echo ** valu = \m(valu)
  36. :   increment \m(valu)
  37. :   echo ** valu = \m(valu)
  38. : The result is:
  39. :   ** value = 7
  40. :   ** value = 7
  41. Just put the macro name; don't enclose it in "\m()":
  42.  
  43.   define valu 7
  44.   echo ** valu = \m(valu)
  45.  
  46.   increment valu
  47.   echo ** valu = \m(valu)
  48.  
  49. This might seem confusing, but it makes sense.  The \m() notation is
  50. for use in unstructured environments.  It tells Kermit to make a string
  51. subsitution where it normally is expecting literal text.  But in command
  52. fields that accept only variable names, such as DEFINE, INCREMENT, etc,
  53. you put the macro or variable name itself.
  54.  
  55. - Frank